gtkstylecontext: Optimize GtkStyleContext usage
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Nov 2014 02:10:29 +0000 (18:10 -0800)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Nov 2014 02:10:55 +0000 (18:10 -0800)
gtk/gtkstylecontext.c

index 3745804f0d832424d4f1bc0a7f1443ee28fd652b..8205ec807e3f195692f0bcc5411aeca860c125d3 100644 (file)
@@ -3255,14 +3255,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     }
   else
     {
-      gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, color);
+      GtkStateFlags state;
+
+      state = gtk_style_context_get_state (context);
+
+      gtk_style_context_get_color (context, state, color);
 
       if (!primary)
       {
         GdkRGBA bg;
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-        gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg);
+        gtk_style_context_get_background_color (context, state, &bg);
 G_GNUC_END_IGNORE_DEPRECATIONS
 
         color->red = (color->red + bg.red) * 0.5;